package com.seu.me.disruptor.generate2;

import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;
import com.seu.me.disruptor.generate1.Trade;

/**
 * Created by liangfeihu on 2017/11/27.
 */
public class Handler1 implements EventHandler<Trade>, WorkHandler<Trade> {

    @Override
    public void onEvent(Trade event, long sequence, boolean endOfBatch) throws Exception {
        this.onEvent(event);
    }

    @Override
    public void onEvent(Trade event) throws Exception {
        System.out.println("eventId=" + event.getId() + ", handler1: set name");
        event.setName("h1");
        Thread.sleep(1000);
    }
}  